// 后端通信的逻辑
import http from "../utils/http.js";

// api 开头
export function apiLogin({ username, password }) {
  return http.post("/login", {
    username,
    password,
  });
}

export function apiGetPhotos() {
  // token
  return http.get("/getPhotos");
}

export function apiUpload(file) {
  const formData = new FormData();
  formData.append("img", file);

  return http.post("/upload", formData);
}
